package cn.edu.xmist.strategy;

public class StrategyTest {
    public static void main(String[] args) {
        Integer status = 3;

        float prise = 0f;

        float km = 6;

        Context context = new Context();

        if (status == 1) {
//            prise = (float)0.5*km;
            context.setStrategy(new OneStrategy());
            prise = context.getPrise(km);

        } else if (status == 2) {
//            prise = (float)0.35*km;
            context.setStrategy(new SenondStrategy());
            prise = context.getPrise(km);

        }  else {
//            prise = (float)0.7*km;
            context.setStrategy(new DefaultStrategy());
            prise = context.getPrise(km);
        }

        System.out.println("prise = " + prise);
    }
}
